package com.lsh.oms.core.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Project Name: lsh-groupon
 *
 * @author peter
 * @date 17/7/7
 * 北京链商电子商务有限公司
 * Package
 * desc:
 */
@Getter
public enum PayChannel {
    /**
     *
     */
    NO(0,"0","未支付"),
    ALI(1,"1","支付宝"),
    WX(2,"2","微信"),
    MONEY(3,"3","现金"),
//    POS(4,"4","货到POS付款"),
//    LAKLA(5,"5","拉卡拉"),
    WXSM(6,"6","微信扫码"),
    NO_PAY(7,"7","不需要支付"),
    ALI_PAY(8,"8","支付宝扫码"),
    ON_CREDIT(9,"9","赊账"),
    BALANCE_PAYMENT(10,"10","钱包余额"),
    PRE_PAYMENT(11,"11","预付"),
    ZP_PAY(12,"12","支票支付");

    private int index;
    private String code;
    private String name;

    PayChannel(int index,String code, String name) {
        this.index = index;
        this.code = code;
        this.name = name;
    }

    public static List<String> getAllPayCodes() {
        List<String> list = new ArrayList<>();
        for (PayChannel payChannel : PayChannel.values()) {
            list.add(payChannel.getCode());
        }

        return list;
    }

    public static Map<String,String> payConf(){
        Map<String,String> conf = new HashMap<>();
        for (PayChannel payChannel : PayChannel.values()) {
            conf.put(payChannel.getCode(),payChannel.getName());
        }
        return conf;
    }

}
